/*
 *  @ProductName@
 *  Copyright (C) @CopyrightYear@
 *    National Institute of Advanced Industrial Science and Technology (AIST)
 *    Registration Number: @AISTRegistrationNumber@
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package jp.go.aist.six.vuln.model.scap.cpe.dictionary;

import jp.go.aist.six.util.orm.AbstractPersistable;
import java.util.ArrayList;
import java.util.Collection;




/**
 * The CpeList acts as a top-level container for CPE Name items.
 * Each individual item must be unique.
 *
 * @author	Akihito Nakamura, AIST
 * @version $Id: CpeList.java 138 2010-05-21 00:48:43Z nakamura5akihito $
 */
public class CpeList
    extends AbstractPersistable
{

    /**
     */
    private Generator  _generator;
    //{0..1}

    /**
     */
    private Collection<CpeItem>  _item = new ArrayList<CpeItem>();
    //{1..*}

    private ComponentTree  _componentTree = new ComponentTree();
//    private Collection<AdditionalListElement>  _additionalElements
//    = new ArrayList<AdditionalListElement>();
    //{xsd:any, 0..*}


    /**
     * Constructor.
     */
    public CpeList()
    {
    }



    /**
     */
    public void setGenerator(
                    final Generator generator
                    )
    {
        _generator = generator;
    }


    /**
     */
    public Generator getGenerator()
    {
        return _generator;
    }



    /**
     */
    public Collection<CpeItem> getItem()
    {
        return _item;
    }


    /**
     */
    public void setItem(
                    final Collection<CpeItem> item
                    )
    {
        if (item != _item) {
            _item.clear();
            if (item != null) {
                _item.addAll( item );
            }
        }
    }



    /**
     */
    public void setComponentTree(
                    final ComponentTree tree
                    )
    {
        _componentTree = tree;
    }


    /**
     */
    public ComponentTree getComponentTree()
    {
        return _componentTree;
    }



//    /**
//     */
//    public void setAdditionalElements(
//                    final Collection<AdditionalListElement> elements
//                    )
//    {
//        if (elements != _additionalElements) {
//            _additionalElements.clear();
//            if (elements != null  &&  elements.size() > 0) {
//                _additionalElements.addAll( elements );
//            }
//        }
//    }
//
//
//    /**
//     */
//    public Collection<AdditionalListElement> getAdditionalElements()
//    {
//        return _additionalElements;
//    }

}
// CpeList
